#pragma once

#include "childwnd.h"
#include "ToolWnd.h"
#include "resource.h"
#include "Vec2.h"
#include "PlantSpecies.h"

class DesignInterface :
	public ChildWnd
{
public:	
	
	RectF drawArea;

	DesignInterface(HWND hParentWnd);
	~DesignInterface(void);

	void onLButtonClick(double x, double y);
	void onRButtonClick(double x, double y);
	void onMouseWeel(double x, double y);
	void onPaint(Graphics* g);

	virtual void designOnLButtonClick(double x, double y);
	virtual void designOnRButtonClick(double x, double y);
	virtual void designOnMouseWeel(double x, double y);
	virtual void designOnPaint(Graphics* g);

	static CbItem stanovisko[];
	static int cStanoviste;
	static CbItem sociabilita[];
	static int cSociabilita;
	static CbItem obmedzenie[];
	static int cObmedzenie;		
	
	Vec2 getNormalized(Vec2 v);
	Vec2 normalize(Vec2 v);

	void onDeactive();

private:
	HWND hS_stanovisko;
	HWND hCB_stanovisko;

	HWND hS_sociabilita;
	HWND hCB_sociabilita;

	HWND hS_rastlina;
	HWND hCB_plantName;

	HWND hS_obmedzenie;
	HWND hCB_obmedzenie;

	void showMyToolBox();
	void hideMyToolBox();
	void moveMyToolBox(int to);

	void fillComboBox(HWND hWnd);
	void initToolBox(HWND hWnd);


	void updateDrawArea();

protected:
	PlantSpecies* getSelectedPlant();

	void onActive();
	void command(HANDLE hControl, WORD id, WORD msg);
	void onMoveMyTools(int to);
};

